package crazyboyfeng.autodroid.ui;

import android.app.AlertDialog;
import android.content.Intent;
import android.os.Bundle;
import android.preference.Preference;
import android.preference.Preference.OnPreferenceClickListener;
import android.preference.PreferenceActivity;
import android.preference.PreferenceScreen;
import android.util.Log;
import android.view.MenuItem;
import android.widget.Toast;

import crazyboyfeng.autodroid.R;

public class SettingActivity extends PreferenceActivity{
    @Override
    protected void onCreate(final Bundle savedInstanceState)
    {
    	SettingFragment setting = new SettingFragment();
        super.onCreate(savedInstanceState);
        this.getActionBar().setDisplayHomeAsUpEnabled(true);
        getFragmentManager().beginTransaction().replace(android.R.id.content, setting).commit();
    }

	@Override
	public void onBackPressed() {
		// TODO Auto-generated method stub
		super.onBackPressed();
		overridePendingTransition(R.anim.slide_in_down,R.anim.slide_out_down);  
	}
	
	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
	    switch (item.getItemId()) {
	        case android.R.id.home:
	            this.finish();
	            overridePendingTransition(R.anim.slide_in_down,R.anim.slide_out_down);  
	            return true;
	        default:
	            return super.onOptionsItemSelected(item);
	    }
	}
}
